package com.ctsi.canal.starter.handler;

import com.ctsi.canal.starter.config.annotation.CanalTableHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * 系统提供的默认处理方法
 *
 * @author ajh
 * @date 2019/10/25 8:50
 **/
@CanalTableHandler(tableName = "all", event = "")
@Component
@Slf4j
public class DefaultEntryHandler implements EntryHandler<Map<String, String>> {

    @Override
    public void insert(Map<String, String> map) {
        log.info("增加 {}", map);
    }

    @Override
    public void update(Map<String, String> before, Map<String, String> after) {
        log.info("修改 before {}", before);
        log.info("修改 after {}", after);
    }

    @Override
    public void delete(Map<String, String> map) {
        log.info("删除 {}", map);
    }
}
